package com.itheima.health.dao;

import com.itheima.health.pojo.OrderSetting;
import com.itheima.health.vo.OrderSettingVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.Date;
import java.util.List;


/**
 * @author
 */
@Mapper
public interface OrderSettingDao {


    List<OrderSettingVO> findAll(String  orderDate);
    void insert(OrderSetting orderSetting);

    long findCountByOrderDate(Date orderDate);

    void editNumberByOrderDate(OrderSetting orderSetting);

    @Select("select  *  from t_ordersetting  where order_date=#{orderDate}")
    OrderSetting findByDate(Date orderDate);
    /**
     * 预约成功人数加1
     * @param orderDate
     */
    @Update("update   t_ordersetting   set reservations=(reservations+1) where order_date=#{orderDate}")
    void update(Date orderDate);
}
